﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Corsat.Desktop.UserControls
{
    public partial class ucSearch : UserControl
    {
        public ucSearch()
        {
            InitializeComponent();
        }

        private void ucSearch_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            //if (!String.IsNullOrEmpty(tbArabicName.Text))
            //      lstAccounts.DataSource = Library.DataManager.Main.Search(tbArabicName.Text, "", "");
            //else
            //    if (!String.IsNullOrEmpty(txtSSN.Text))
            //          lstAccounts.DataSource = Library.DataManager.Main.Search("", txtSSN.Text, "");
            //    else
            //        if (!String.IsNullOrEmpty(txtAccountNumber.Text))
            //              lstAccounts.DataSource = Library.DataManager.Main.Search("", "", txtAccountNumber.Text);
            //        else
            //            lstAccounts.DataSource = Library.DataManager.Main.Search("", "", "");

            lstAccounts.DisplayMember = "Value";
            lstAccounts.ValueMember = "Id";

            
        }

        private void button2_Click(object sender, EventArgs e)
        {
            
            
             int i = Convert.ToInt32(lstAccounts.SelectedValue);

            ucProfile profile = new ucProfile(i);

            this.ParentForm.Controls.Add(profile);

            this.ParentForm.Controls.RemoveAt(0);
           
        }
    }
}
